package com.qf.controller;


import com.qf.bean.AjaxMessage;
import com.qf.entity.Grade;
import com.qf.service.IGradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lcx
 * @since 2020-09-03
 */
@RestController
@RequestMapping("/grade")
public class GradeController {
    @Autowired
    IGradeService gradeService;

    @RequestMapping("/select")
    public AjaxMessage selectGrade(){
        List<Grade> grades = gradeService.list();
        if (grades != null && grades.size()!= 0){
            return new AjaxMessage(0,"",grades);
        }
        return new AjaxMessage(1,"查询失败");
    }

}
